//
//  BaseViewController.m
//  30303
//
//  Created by student on 16/3/18.
//  Copyright © 2016年 niit. All rights reserved.
//

#import "BaseViewController.h"

@interface BaseViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *plane;

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    
    //    CABasicAnimation *anim1 = [CABasicAnimation animationWithKeyPath:@"opacity"];
    //    anim1.duration = 2.0; // 动画过程的时间
    //    anim1.fromValue = @1; // 起始值
    //    anim1.toValue = @0;   // 终止值
    //    anim1.repeatCount = 1; // 次数
    //    anim1.fillMode = kCAFillModeRemoved; // 保持动画最后的数值 ?
    //
    //    [self.plane.layer addAnimation:anim1 forKey:@"animate1"];
    
    //    CABasicAnimation *anim2 = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
    //    anim2.duration = 1.0; // 动画过程的时间
    //    anim2.fromValue = @0.1; // 起始值
    //    anim2.toValue = @2;   // 终止值
    //    anim2.repeatCount = 1; // 次数
    //
    //    [self.plane.layer addAnimation:anim2 forKey:@"animate2"];
    
    
    CABasicAnimation *anim3 = [CABasicAnimation animationWithKeyPath:@"contents"];
    anim3.duration = 1.0; // 动画过程的时间
    anim3.fromValue = (id)[UIImage imageNamed:@"clipartPlane"].CGImage;
    anim3.toValue = (id)[UIImage imageNamed:@"Icon"].CGImage;;   // 终止值
    anim3.repeatCount = 1; // 次数
    anim3.fillMode = kCAFillModeForwards;
    [self.plane.layer addAnimation:anim3 forKey:@"animate3"];
    
}


@end
